﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Xml;
using T.FAS.Runtime.Base.Entity;

namespace T.FAS.Runtime.DataAccess.Common
{
    public class DatabaseTool
    {
        public static string GetDefaultDateFunc(string dbType)
        {
            DatabaseType databaseType = (DatabaseType)Enum.Parse(typeof(DatabaseType), dbType);
            return GetDefaultDateFunc(databaseType);
        }

        public static string GetDefaultDateFunc(DatabaseType databaseType)
        {
            string dateFunc;
            if (databaseType == DatabaseType.SQLServer)
                dateFunc = "getdate()";
            else if (databaseType == DatabaseType.MySQL)
                dateFunc = "now()";
            else
                dateFunc = "getdate()";
            return dateFunc;
        }
    }
}